package com.zecan.blog.vo.user;

import com.zecan.blog.entity.BlogUser;
import com.zecan.blog.security.entity.AccountUser;
import lombok.Data;

/**
 * 显示登录用户信息的Vo
 *
 * @ClassName UserInfoVo
 * @Description
 * @date 2022/11/8 11:32
 * @Version 1.0
 */
@Data
public class BlogUserInfoVo {

    String loginUrlAvatar;

    String nickname;

    String username;

    String email;

    String password;

    Long userId;

    Integer userArticleCount;
    public static BlogUserInfoVo getUserInfoVo(AccountUser user) {
        BlogUserInfoVo userInfoVo = new BlogUserInfoVo();


        userInfoVo.userId = user.getUserId();
        userInfoVo.loginUrlAvatar = user.getUserAvatar();
        userInfoVo.username = user.getUsername();
        userInfoVo.nickname = user.getNickname();
        userInfoVo.email = user.getEmail();
        userInfoVo.userArticleCount = user.getUserArticleCount();
        return userInfoVo;
    }

}
